$().ready(function(){
	
    $baseUrl=$("#baseUrl").text();
    
  
    function adjustPicture(){
    	
    	$(".thumbnailContainer img").each(function(){
    		width = $(this).attr("clientWidth");
    		height = $(this).attr("clientHeight");
    		
    		if (width<= 100 && height<= 100) {
    			left = (100-width)/2;
    			top = (100-height)/2;
    			$(this).css("margin-left",left);
    			$(this).css("margin-top",top);
    		} else if (width<=100) {
    			left = (100-width)/2;
    			top = (height-100)/2;
    			$(this).css("margin-left",left);
    			$(this).css("margin-top",-top);
    		} else if (height<=100){
    			left = (width-100)/2;
    			top = (100-height)/2;
    			$(this).css("margin-left",-left);
    			$(this).css("margin-top",top);
    		} else {
    			left = (width-100)/2;
    			top = (height-100)/2;
    			$(this).css("margin-left",-left);
    			$(this).css("margin-top",-top);
    		}
    		
    	});
    }
    
   
    adjustPicture();
    
    $(".itemAction").hide();
    $(".item").hover(
    		function(){$(this).addClass("chosen"); $(this).find(".itemAction").show(); },
    		function(){$(this).removeClass("chosen"); $(this).find(".itemAction").hide(); });
});